import {
	GetRecentPlays
} from '@/api/index.js'

//准备actions对象——响应组件中用户的动作
const actions = {
	// 获取最近播放
	async GetRecentPlays(state) {
		let info = await GetRecentPlays()
		state.commit('setRecentPlays', info['data']['list'])
	}
}
//准备mutations对象——修改state中的数据
const mutations = {
	setRecentPlays(state, obj) {
		state.RecentPlays = obj
	}
}
//准备state对象——保存具体的数据
const state = {
	RecentPlays: [], //	最近播放列表
}


export default ({
	state,
	mutations,
	actions,
	namespaced: true,
})
